-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SlotFill: Refactor <Slot bubblesVirtually />
#53272
SlotFill: Refactor <Slot bubblesVirtually />
#53272
Conversation
Size Change: +1 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
I think @jsnajdr could help with a review here since I know he recently spent some time understanding the two different versions of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, ignoring the children
prop looks like a good idea 👍
packages/components/CHANGELOG.md
Outdated
@@ -2,6 +2,10 @@ | |||
|
|||
## Unreleased | |||
|
|||
### Internal | |||
- `SlotFill`: Refactor `<Slot bubblesVirtually />` ([#53272](https://github.com/WordPress/gutenberg/pull/53272)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a changelog entry, "refactor" doesn't say anything meaningful. Let's describe the user-visible change in <Slot bubblesVirtually>
: when rendered with children
, it will ignore them. Previously they would be rendered.
@@ -41,7 +49,11 @@ function Slot( | |||
} ); | |||
|
|||
return ( | |||
<Component ref={ useMergeRefs( [ forwardedRef, ref ] ) } { ...props } /> | |||
<View |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to use the View
component here? Seems to me that the original div
was fine, and that now we're just adding more indirection and complexity. Is there any tangible benefit from the fact that the div
is now styled with Emotion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsnajdr Thanks.
In the original Pull Request, I changed to View to avoid error: TS2590
, which I am trying to address in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, so it's not because of View
functionality, but to solve a typing problem. Hopefully in future, when the rename from JS to TS is done, we can find a way to go back to simple div
.
bbee740
to
362b6d4
Compare
@jsnajdr Thank you for reviewing! |
@@ -46,7 +49,6 @@ | |||
|
|||
- `ColorPalette`, `BorderControl`: Don't hyphenate hex value in `aria-label` ([#52932](https://github.com/WordPress/gutenberg/pull/52932)). | |||
- `MenuItemsChoice`, `MenuItem`: Support a `disabled` prop on a menu item ([#52737](https://github.com/WordPress/gutenberg/pull/52737)). | |||
- `TabPanel`: Introduce a new version of `TabPanel` with updated internals and improved adherence to ARIA guidance on `tabpanel` focus behavior while maintaining the same functionality and API surface.([#52133](https://github.com/WordPress/gutenberg/pull/52133)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a mistake. Commit to PR #51350.
What?
part of #51350
see: https://github.com/WordPress/gutenberg/pull/51350/files#r1223434900
Why?
Separated the changes made in #51350 that should be handled as a separate PR.
How?
<Slot bubblesVirtually />
is not supportchildren
function prop now. So, removechildren
.<View>
.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast